require(['config'], function() {
	require(['zepto', 'resize', 'swiper', 'swiper.animate','common'], function($) {
		$(function() {

			var menuicon = $('#menuicon');
			var sousuopo = $('#sousuopo');
			menuicon.on('click', function(e) {
				sousuopo.toggle();
				return false;
			});

			var mySwiper = new Swiper('.sWiper-container', {
				// 如果需要分页器
				pagination: '.swiper-pagination',
				slidesPerView: 1,
				centeredSlides: true,
				autoplay: 3000,
				loop: true,
				autoplayDisableOnInteraction: true
			})
			
			
			var MySwiper = new Swiper('.Swiper-container', {
				direction: 'horizontal',
				loop: true,
				slidesPerView: 0,
				centeredSlides: false,
			});
		
			var mySwiper = new Swiper('.sWiper-container', {
				// 如果需要分页器
				pagination: '.swiper-pagination',
				slidesPerView: 1,
				centeredSlides: true,
				autoplay: 3000,
				loop: true,
				autoplayDisableOnInteraction: true
			})
		
			var MySwiper = new Swiper('.Swiper-container', {
				direction: 'horizontal',
				loop: true,
				slidesPerView: 0,
				centeredSlides: false,
			});
			
			//返回顶部
			var returnTop = $('#returnTop');
			var returntop = Hammer(returnTop[0]);
			returntop.on('tap', function(e) {
				var timer = setInterval(function() {
					var scrollTop = $(window).scrollTop();
					var speed = scrollTop / -10;
					scrollBy(0, Math.floor(speed));
					if(scrollTop <= 0) {
						clearInterval(timer);
					}
				},30);
			});
			$(window).scroll(function() {
//					 1、获取每次滚动时与顶部的距离
//					 在使用获取与顶部的距离
				var scrollTop = $(window).scrollTop();
//					 2、如果与顶部的距离 >= 150就显示topbar
				if(scrollTop >= 150) {
					returnTop.show();
				} else {
					returnTop.hide();
				}
			});
		});
	});
});